.class Lrexsee/keyboard/RexseeSensorBoard$1;
.super Ljava/lang/Object;
.source "RexseeSensorBoard.java"

# interfaces
.implements Landroid/hardware/SensorEventListener;


# annotations
.annotation system Ldalvik/annotation/EnclosingMethod;
    value = Lrexsee/keyboard/RexseeSensorBoard;->start(Ljava/lang/String;IIIIIII)V
.end annotation

.annotation system Ldalvik/annotation/InnerClass;
    accessFlags = 0x0
    name = null
.end annotation


# instance fields
.field final synthetic this$0:Lrexsee/keyboard/RexseeSensorBoard;

.field private final synthetic val$accuracy:I

.field private final synthetic val$cycle:I

.field private final synthetic val$zAngle:I


# direct methods
.method constructor <init>(Lrexsee/keyboard/RexseeSensorBoard;III)V
    .locals 0

    .prologue
    .line 1
    iput-object p1, p0, Lrexsee/keyboard/RexseeSensorBoard$1;->this$0:Lrexsee/keyboard/RexseeSensorBoard;

    iput p2, p0, Lrexsee/keyboard/RexseeSensorBoard$1;->val$cycle:I

    iput p3, p0, Lrexsee/keyboard/RexseeSensorBoard$1;->val$zAngle:I

    iput p4, p0, Lrexsee/keyboard/RexseeSensorBoard$1;->val$accuracy:I

    .line 115
    invoke-direct {p0}, Ljava/lang/Object;-><init>()V

    return-void
.end method


# virtual methods
.method public onAccuracyChanged(Landroid/hardware/Sensor;I)V
    .locals 0
    .param p1, "sensor"    # Landroid/hardware/Sensor;
    .param p2, "accuracy"    # I

    .prologue
    .line 118
    return-void
.end method

.method public onSensorChanged(Landroid/hardware/SensorEvent;)V
    .locals 9
    .param p1, "event"    # Landroid/hardware/SensorEvent;

    .prologue
    .line 121
    iget-object v5, p1, Landroid/hardware/SensorEvent;->sensor:Landroid/hardware/Sensor;

    invoke-virtual {v5}, Landroid/hardware/Sensor;->getType()I

    move-result v5

    const/4 v6, 0x3

    if-eq v5, v6, :cond_1

    .line 146
    :cond_0
    :goto_0
    return-void

    .line 122
    :cond_1
    invoke-static {}, Ljava/lang/System;->currentTimeMillis()J

    move-result-wide v0

    .line 123
    .local v0, "curTime":J
    iget-object v5, p0, Lrexsee/keyboard/RexseeSensorBoard$1;->this$0:Lrexsee/keyboard/RexseeSensorBoard;

    # getter for: Lrexsee/keyboard/RexseeSensorBoard;->lastUpdate:J
    invoke-static {v5}, Lrexsee/keyboard/RexseeSensorBoard;->access$0(Lrexsee/keyboard/RexseeSensorBoard;)J

    move-result-wide v5

    const-wide/16 v7, -0x1

    cmp-long v5, v5, v7

    if-eqz v5, :cond_2

    iget-object v5, p0, Lrexsee/keyboard/RexseeSensorBoard$1;->this$0:Lrexsee/keyboard/RexseeSensorBoard;

    # getter for: Lrexsee/keyboard/RexseeSensorBoard;->lastUpdate:J
    invoke-static {v5}, Lrexsee/keyboard/RexseeSensorBoard;->access$0(Lrexsee/keyboard/RexseeSensorBoard;)J

    move-result-wide v5

    sub-long v5, v0, v5

    iget v7, p0, Lrexsee/keyboard/RexseeSensorBoard$1;->val$cycle:I

    int-to-long v7, v7

    cmp-long v5, v5, v7

    if-ltz v5, :cond_0

    .line 124
    :cond_2
    iget-object v5, p0, Lrexsee/keyboard/RexseeSensorBoard$1;->this$0:Lrexsee/keyboard/RexseeSensorBoard;

    invoke-static {v5, v0, v1}, Lrexsee/keyboard/RexseeSensorBoard;->access$1(Lrexsee/keyboard/RexseeSensorBoard;J)V

    .line 125
    iget-object v5, p1, Landroid/hardware/SensorEvent;->values:[F

    const/4 v6, 0x1

    aget v3, v5, v6

    .line 126
    .local v3, "y":F
    iget-object v5, p1, Landroid/hardware/SensorEvent;->values:[F

    const/4 v6, 0x2

    aget v5, v5, v6

    iget v6, p0, Lrexsee/keyboard/RexseeSensorBoard$1;->val$zAngle:I

    int-to-float v6, v6

    sub-float v4, v5, v6

    .line 128
    .local v4, "z":F
    invoke-static {v3}, Ljava/lang/Math;->abs(F)F

    move-result v5

    invoke-static {v4}, Ljava/lang/Math;->abs(F)F

    move-result v6

    cmpl-float v5, v5, v6

    if-lez v5, :cond_5

    .line 129
    iget v5, p0, Lrexsee/keyboard/RexseeSensorBoard$1;->val$accuracy:I

    int-to-float v5, v5

    cmpl-float v5, v3, v5

    if-lez v5, :cond_3

    .line 130
    const/4 v2, 0x2

    .line 145
    .local v2, "newDirection":I
    :goto_1
    iget-object v5, p0, Lrexsee/keyboard/RexseeSensorBoard$1;->this$0:Lrexsee/keyboard/RexseeSensorBoard;

    # invokes: Lrexsee/keyboard/RexseeSensorBoard;->sendKey(I)V
    invoke-static {v5, v2}, Lrexsee/keyboard/RexseeSensorBoard;->access$2(Lrexsee/keyboard/RexseeSensorBoard;I)V

    goto :goto_0

    .line 131
    .end local v2    # "newDirection":I
    :cond_3
    iget v5, p0, Lrexsee/keyboard/RexseeSensorBoard$1;->val$accuracy:I

    neg-int v5, v5

    int-to-float v5, v5

    cmpg-float v5, v3, v5

    if-gez v5, :cond_4

    .line 132
    const/4 v2, 0x3

    .restart local v2    # "newDirection":I
    goto :goto_1

    .line 134
    .end local v2    # "newDirection":I
    :cond_4
    const/4 v2, -0x1

    .restart local v2    # "newDirection":I
    goto :goto_1

    .line 137
    .end local v2    # "newDirection":I
    :cond_5
    iget v5, p0, Lrexsee/keyboard/RexseeSensorBoard$1;->val$accuracy:I

    int-to-float v5, v5

    cmpl-float v5, v4, v5

    if-lez v5, :cond_6

    .line 138
    const/4 v2, 0x1

    .restart local v2    # "newDirection":I
    goto :goto_1

    .line 139
    .end local v2    # "newDirection":I
    :cond_6
    iget v5, p0, Lrexsee/keyboard/RexseeSensorBoard$1;->val$accuracy:I

    neg-int v5, v5

    int-to-float v5, v5

    cmpg-float v5, v4, v5

    if-gez v5, :cond_7

    .line 140
    const/4 v2, 0x0

    .restart local v2    # "newDirection":I
    goto :goto_1

    .line 142
    .end local v2    # "newDirection":I
    :cond_7
    const/4 v2, -0x1

    .restart local v2    # "newDirection":I
    goto :goto_1
.end method
